#pragma once

class OFConfigFile;

struct DCMPRINTER
{
	DCMPRINTER()
	{
		Type = "PRINTER";
		BorderDensity = "150\\20\\BLACK\\WHITE";
		DisableNewVRs = false;
		DisplayFormat = "1,1\\1,2\\2,1\\2,2\\2,3\\3,3\\3,4\\3,5\\4,4\\4,5";
		EmptyImageDensity = "20\\BLACK\\WHITE";
		FilmDestination = "MAGAZINE\\PROCESSOR\\BIN_1\\BIN_2";
		FilmSizeID = "8INX10IN\\10INX12IN\\10INX14IN\\11INX14IN\\14INX14IN\\14INX17IN";
		ImplicitOnly = false;
		MagnificationType = "REPLICATE\\BILINEAR\\CUBIC";
		MaxDensity = "320";
		MaxPDU = "32768";
		MediumType = "PAPER\\CLEAR FILM\\BLUE FILM";
		MinDensity = "20";
		OmitSOPClassUIDFromCreateResponse = false;
		PresentationLUTMatchRequired = false;
		PresentationLUTinFilmSession = false;
		ResolutionID = "STANDARD\\HIGH";
		SmoothingType = "NONE";
		Supports12Bit = true;
		SupportsDecimateCrop = true;
		SupportsImageSize = true;
		SupportsPresentationLUT = true;
		SupportsTrim = true;
	}
	std::string PrinterName;
	std::string Aetitle;
	std::string Description;
	std::string Hostname;
	std::string Port;
	std::string Type;
	std::string BorderDensity;
	bool		DisableNewVRs;
	std::string DisplayFormat;
	std::string EmptyImageDensity;
	std::string FilmDestination;
	std::string FilmSizeID;
	bool        ImplicitOnly;
	std::string MagnificationType;
	std::string MaxDensity;
	std::string MaxPDU;
	std::string MediumType;
	std::string MinDensity;
	bool        OmitSOPClassUIDFromCreateResponse;
	bool        PresentationLUTMatchRequired;
	bool		PresentationLUTinFilmSession;
	std::string ResolutionID;
	std::string SmoothingType;
	bool		Supports12Bit;
	bool		SupportsDecimateCrop;
	bool		SupportsImageSize;
	bool		SupportsPresentationLUT;
	bool		SupportsTrim;

	bool operator==(const DCMPRINTER& val)
	{
		return strcmp(PrinterName.c_str(), val.PrinterName.c_str()) == 0;
	}

	bool operator==(const std::string& val)
	{
		return strcmp(PrinterName.c_str(), val.c_str()) == 0;
	}
};

typedef std::vector<DCMPRINTER> vec_dcmprinter_type;
typedef std::list<DCMPRINTER> list_dcmprinter_type;

class CPrinterConfig
{
public:
	CPrinterConfig(const char *config_file = NULL);

	~CPrinterConfig(void);

	int GetNumberOfPrinter();
	int GetPrinters(vec_dcmprinter_type& vec);
	int GetPrinters(list_dcmprinter_type& li);
private:
	OFConfigFile *m_pConfig;
	const char *getConfigEntry(const char *l2_key, const char *l1_key, const char *l0_key);
	bool getConfigBoolEntry(const char *l2_key, const char *l1_key, const char *l0_key, bool deflt);
};

